package com.cxb.servicemap.service;

import com.cxb.internalcommon.dto.ResponseResult;
import com.cxb.internalcommon.responese.DirectionResponse;
import com.cxb.internalcommon.responese.ForecastPriceResponse;
import com.cxb.servicemap.remote.MapDirectionClient;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.awt.print.PrinterAbortException;
import java.util.Map;

@Service
@Slf4j
public class DirectionService {

    @Autowired
    private MapDirectionClient mapDirectionClient;

    /**
     *
     * @param depLongitude 起点经度
     * @param depLatitude 起点维度
     * @param destLongitude 目的经度
     * @param destLatitude 目的维度
     * @return
     */
    public ResponseResult driving(String depLongitude, String depLatitude , String destLongitude, String destLatitude) {

        //调用第三方接口
        DirectionResponse direction = mapDirectionClient.direction(depLongitude, depLatitude, destLongitude, destLatitude);

        return ResponseResult.success(direction);
    }
}
